<!DOCTYPE html>
<html>
    <head>
        <title>测试同步到$model</title>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <script src="avalon.js" type="text/javascript"></script>
        <script>
            var model = avalon.define("test", function(vm) {
                vm.rows = {name: 'a', age: 45}
                vm.aaa = "OO"
                vm.arr = [{name: "55"}]
                vm.log = function() {
                    if (window.console) {
                        console.log(model.$model)
                    }
                }
            });

        </script>
    </head>
    <body>
        <h3>测试同步到$model</h3>
        <fieldset ms-controller="test">
            <table border="1" width="80%">
                <tr ms-repeat-row='rows'>
                    <td>
                        {{$key}}: {{$val}} <input ms-duplex="$val">
                    </td>
                </tr>
            </table>
            <ul ms-each="arr">
                <li>{{el.name}}<input ms-duplex="el.name"></li>
            </ul>
            <input ms-duplex="aaa"/>
            <p>
                <button ms-click="log">log</button>
            </p>
        </fieldset>
    </body>
</html>